export function transListToTreeData(arr) {
  const parent = arr.filter(item => !item.p_id)

  parent.forEach(item1 => {
    item1.children = arr.filter(item2 => item1.id === item2.p_id)
  })

  return parent
}
